package com.tencent.examples.core.job;

import com.tencent.examples.blueking.mysql.service.BkStoreTimeService;
import com.tencent.examples.core.service.IBkMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author :  CHENWEN
 * @Description :
 * @Creation Date:  2019/3/29
 */
@Component
public class StoreJob {
    @Autowired
    IBkMessageService bkMessageService;
    @Autowired
    BkStoreTimeService bkStoreTimeService;

    /**
     * 每天凌晨1点执行更新
     */
    @Scheduled(cron = "0 0 1 * * ?")
    public void cronJob() {
        bkMessageService.syncStore();
    }


    /**
     * 每小时查询一次今天是否有闭店的数据
     */
    @Scheduled(cron = "0 1 0 * * ?")
    public void cronJob1() {
        bkStoreTimeService.storeCloseDay();
    }
}
